<?php
$ArNotices = Dracosys::getSessionValue(SESSION_INTERFACE, 'NoticesList');
?>
<section id="NoticesList">
    <h2>Listar Avisos</h2>
    <table id="NoticesList_notices" class="list">
        <thead>
            <tr>
                <th>Título</th>
                <th>Categoria</th>
                <th>Criado por</th>
                <th>Setor</th>
                <th>Visualizar</th>
            </tr>
        </thead>
        <tfoot>
        </tfoot>
        <tbody>
            <?php
            if( !empty($ArNotices) ):
                foreach($ArNotices as $Notice): ?>
                    <tr>
                        <td><?=$Notice->getStTitulo()?></td>
                        <td><?=$Notice->getCategoria()->getStCategoria()?></td>
                        <td><?=$Notice->getUsuario()->getArDadosUsuario('StNome')?></td>
                        <td><?=($Notice->isPublic() ? 'TODOS' : 'Setor: ' . $Notice->getSetor()->getStNome())?></td>
                        <td>
                            <a href="<?=DRA_URL?>aviso/visualizar/id/<?=$Notice->getIDAviso()?>" title="Visualizar">
                                <img src="<?= DRA_VIEW_URL ?>images/descricao.png" />
                            </a>
                        </td>
                    </tr>
                <?php
                    endforeach;
                else:
                    ?>
                    <tr class="nodata">
                        <td colspan="5">
                            Nenhum resultado foi encontrado!
                        </td>
                    </tr>
                    <?php
                endif;
                ?>
        </tbody>
    </table>
</section>

